package org.nmgyjt.springboot.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nimbusds.jose.JOSEException;
import org.nmgyjt.springboot.beans.admin.CsSystemUserSelectBean;
import org.nmgyjt.springboot.beans.admin.CsSystemUserstatisticBean;
import org.nmgyjt.springboot.beans.admin.StatisticBean;
import org.nmgyjt.springboot.entity.ApiRes;
import org.nmgyjt.springboot.entity.admin.UserInfo;
import org.nmgyjt.springboot.entity.equipage.Equipage;
import org.nmgyjt.springboot.service.*;
import org.nmgyjt.springboot.utils.IDAASUserUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.text.ParseException;

@RestController
@RequestMapping("/cs/statistics")
public class StatisticsController {
    @Autowired
    private RescueTeamService rescueTeamService;
    @Autowired
    private RefugeService refugeService;
    @Autowired
    private StoreService storeService;
    @Autowired
    private ProtectTargetService protectTargetService;
    @Autowired
    private IdaasService idaasService;
    @Autowired
    private ExpertService expertService;
    @PostMapping("/getRescueTeamStatistics")
    public ApiRes getRescueTeamStatistics(@RequestBody StatisticBean statisticBean) {
        return ApiRes.ok(rescueTeamService.statisticRescueTeam(statisticBean));
    }
    @PostMapping("/getrefugeStatistics")
    public ApiRes getrefugeStatistics(@RequestBody StatisticBean statisticBean) {
        return ApiRes.ok(refugeService.getrefugeStatistics(statisticBean));
    }

    @PostMapping("/getstoreStatistics")
    public ApiRes getstoreStatistics(@RequestBody StatisticBean statisticBean) {
        return ApiRes.ok(storeService.getstoreStatistics(statisticBean));
    }

    @PostMapping("/getProtectTargetStatistics")
    public ApiRes getProtectTargetStatistics(@RequestBody StatisticBean statisticBean) {
        return ApiRes.ok(protectTargetService.getProtectTargetStatistics(statisticBean));
    }

    @PostMapping("/getExpertStatistics")
    public ApiRes getExpertStatistics(@RequestBody StatisticBean statisticBean) throws ParseException, JOSEException {
        return ApiRes.ok(expertService.getExpertStatistics(statisticBean));
    }
}
